﻿@model IEnumerable<MobileWebsiteGenerator.Entities.pictureGallery>

@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>


<p>
<a href="@Url.Action("Create")" style="padding:5px;background:brown;">Add More<img src="@Url.Content("~/images/add.gif")" style="margin-top:5px;" /> </a> 
    
</p>

  

@foreach (var item in Model) {
    <table style="float:left;margin:10px;" >
    <tr>
        <td style="width:150px;height:100px;border:2px solid #999;border-radius:4px;">
           
            @if (File.Exists(Server.MapPath(Url.Content("~/Uploads/" + item.ImagePath))))
            {
               <a href="@Url.Action("Edit", new { id = item.picture_id })"> <img src="@Url.Content("~/uploads/" + item.ImagePath)" width="100px" /></a>
            }
            else
            {
                <a href="@Url.Action("Edit", new { id = item.picture_id })"> <img src="@Url.Content("~/uploads/home-icons.png")" width="100px" /></a>
            }   
           
         </td>
     
    </tr>
    <tr> <td><a href="@Url.Action("Delete", new { id = item.picture_id })" style="margin-top:-20px;float:right;"><img src="@Url.Content("~/images/cancel.png")" style="border:0px;" /> </a> </td></tr>
    </table>
}




<p >
<a href="@Url.Action("EditWebsite","AdminCustomer")" style="padding:10px;background-color:Gray;width:150px;height:60px;color:White;">Done! </a>
</p>
